package web;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import pojo.Dept;
import pojo.User;
import service.DeptService;

import java.util.List;

@Controller
public class DeptServlet {

    @Autowired
    private DeptService deptService;

    public Object addDept(Dept dept){

        return deptService.addDept(dept);

    }
    public void updateDept(Dept dept) {
        deptService.update(dept);
    }

    public void deleteDept(int deptid){
        deptService.delete(deptid);
    }

    public List<Dept> findUserAll(){
        return deptService.findUserAll();
    }
    public Dept findUserById(int number){
        return deptService.findUserByNumber(number);
    }


}
